<?php
/**
 * Arrow base exception
 *
 * @license  GNU GPL
 * @author   Artur Kmera <>
 */

class ArrowException extends Exception {

  /**
   * Constructor
   * @param [mixed] $errorData - data with inforamtion about exception - can be a array
   * @param [mixed] $errorCode - number of the error
   * @return void
   */
	public function __construct($errorData, $errorCode = 0) {
		if( is_array($errorData) )
			parent::__construct(serialize($errorData), $errorCode);
		else 
			parent::__construct(serialize( array( "error" => $errorData ) ), $errorCode);		
	}
	
	/**
	 * Let us get exception message
	 * return array - array with exception message
	 */
	public function getMessageArray(){
		return  unserialize(parent::getMessage());
	}

}
?>